package main

//func main() {
//	params := []string{"ab", "a"}
//	println(longestCommonPrefix(params))
//}

func longestCommonPrefix(strs []string) string {

	for _, str := range strs {
		if len(str) == 0 {
			return ""
		}
	}

	for i, char := range strs[0] {
		for _, str := range strs {
			if len(str) <= i || char != int32(str[i]) {
				return strs[0][:i]
			}
		}
	}

	return strs[0]

}
